home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Texteditors / Origami / Sources / src / origami / exit.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-27  |  2.3 KB  |  69 lines

  1. #ifndef ORIEXIT_H
  2. #  define ORIEXIT_H
  3.   /*{{{}}}*/
  4.   /*{{{  get the standard exit codes*/
  5. #  ifndef NOSYSEXIT
  6. #     include <sysexits.h>
  7. #  else
  8.      /*{{{  define missing exitcodes to the 'standard' in UNIX'es*/
  9. #     ifndef EX_OK
  10. #       define EX_OK           0
  11. #     endif
  12. #     ifndef EX_USAGE
  13. #       define EX_USAGE       64
  14. #     endif
  15. #     ifndef EX_DATAERR
  16. #       define EX_DATAERR     65
  17. #     endif
  18. #     ifndef EX_NOINPUT
  19. #       define EX_NOINPUT     66
  20. #     endif
  21. #     ifndef EX_UNAVAILABLE
  22. #       define EX_UNAVAILABLE 69
  23. #     endif
  24. #     ifndef EX_SOFTWARE
  25. #       define EX_SOFTWARE    70
  26. #     endif
  27. #     ifndef EX_OSERR
  28. #       define EX_OSERR       71
  29. #     endif
  30. #     ifndef EX_CANTCREAT
  31. #       define EX_CANTCREAT   73
  32. #     endif
  33. #     ifndef EX_NOPERM
  34. #       define EX_NOPERM      77
  35. #     endif
  36.      /*}}}  */
  37. #  endif
  38.   /*}}}  */
  39.   /*{{{  set start value for own exits*/
  40.   /* the non-standard exits below use the codes                 */
  41.   /*                                                            */
  42.   /* ORIEXITBASE                                                */
  43.   /* ORIEXITBASE+1                                              */
  44.   /*     :                                                      */
  45.   /*                                                            */
  46.   /* maybe some systems need the values 1,.. for other purposes */
  47.  
  48. #  ifndef ORIEXITBASE
  49. #    define ORIEXITBASE 1
  50. #  endif
  51.   /*}}}  */
  52.   /*{{{  definition of all used Exitcodes in a enum*/
  53.   typedef enum
  54.    { r_ok=EX_OK,                  /* successful termination                  */
  55.  
  56.      r_arg_err=EX_USAGE,          /* invalid command line arguments          */
  57.      r_eof=EX_NOINPUT,            /* can't open stdin:'eof or no contr. term */
  58.      r_init_err=EX_UNAVAILABLE,   /* service unavailable: rc,screen,keyboard */
  59.      r_ocl_err=EX_SOFTWARE,       /* internal software error, long line, OCL */
  60.      r_mem_full=EX_OSERR,         /* system error: cannot malloc             */
  61.      r_file_nok=EX_CANTCREAT,     /* can't create output: quit and file chg. */
  62.  
  63.      r_sig=ORIEXITBASE,           /* signal die, maybe tried to dump         */
  64.      r_vir_err,                   /* virtual line handling crash (tmp-file)  */
  65.      exit_failure                 /* should never appear, dummy for rest     */
  66.    } RETURNS;
  67.   /*}}}  */
  68. #endif
  69.